import request from '@/utils/request'
import config from '@/api/config'
const _partUrl = config.api_system
const _get = (url, params) => { return request({ url: _partUrl + url, method: 'get', params }) };
const _post = (url, data) => { return request({ url: _partUrl + url, method: 'post', data }) };
const _put = (url, data) => { return request({ url: _partUrl + url, method: 'put', data }) };
const _delete = (url, params) => { return request({ url: _partUrl + url, method: 'delete', params }) };

//风格：
// getUserInfo() {
//     this.$system
//       .getUserInfo(_param)
//       .then(res => {
//         if (res.code === 200) {
//         } else {
//         }
//       })
//       .catch((res) => {}).finally(()=>{});
//   }

export default {
    post(action,data) {return _post(action, data) },
    put(action,data) {return _put(action, data) },
    get(action,params) {return _get(action, params) },
    delete(action,params) {return _delete(action, params) },
}
